diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py
index c55864243a..011dba2e31 100644
--- a/lib/matplotlib/figure.py
+++ b/lib/matplotlib/figure.py
@@ -3044,17 +3044,18 @@ class Figure(FigureBase):
         self.__dict__ = state
 
         # re-initialise some of the unstored state information
+        print("DEBUG: DPI before re-initialization:", self.dpi)
         FigureCanvasBase(self)  # Set self.canvas.
-
+        # lazy import to avoid circularity
+        import matplotlib.pyplot as plt
+        import matplotlib._pylab_helpers as pylab_helpers
         if restore_to_pylab:
-            # lazy import to avoid circularity
-            import matplotlib.pyplot as plt
-            import matplotlib._pylab_helpers as pylab_helpers
             allnums = plt.get_fignums()
             num = max(allnums) + 1 if allnums else 1
             mgr = plt._backend_mod.new_figure_manager_given_figure(num, self)
             pylab_helpers.Gcf._set_new_active_manager(mgr)
-            plt.draw_if_interactive()
+        plt.draw_if_interactive()
+        print("DEBUG: DPI after re-initialization:", self.dpi)
 
         self.stale = True
 
